<script setup lang="ts">
import { onHide, onLaunch, onShow } from '@dcloudio/uni-app'
import { useI18n } from 'vue-i18n'
const { t, locale } = useI18n()
onLaunch(() => {
  console.log('App Launch')
})
onShow(() => {
  console.log('App Show')
  uni.$on('changeTabbarTxt', (res) => {
    //console.log(' - - 刷新tabbar - changeTabbarTxt')
    uni.setTabBarItem({
      index: 0,
      text: t('home.home'),
      success: (resl) => {
        //console.log(' - - setTabBarItem 0',resl)
      },
    })
    uni.setTabBarItem({
      index: 1,
      text: t('index.receipt'),
      success: (resl) => {
        //console.log(' - - setTabBarItem 1',resl)
      },
    })
    uni.setTabBarItem({
      index: 2,
      text: t('index.recharge'),
    })
    uni.setTabBarItem({
      index: 3,
      text: t('index.mine'),
    })
  })
})
onHide(() => {
  console.log('App Hide')
})
</script>

<style lang="scss">
// 字体图标
@import '@/styles/fonts.scss';
@import '@/styles/base.scss';
</style>
